package com.jwater.core.manager.common.model;

import java.io.Serializable;

import com.jwater.core.common.param.ParamMap;
import com.jwater.core.common.param.ParamMapImpl;

/**
 * @description: 工作进程信息
 * @author: jnner
 * @createDate: 2021/2/5
 * @version: 1.0
 */
public class WorkerInfo implements Serializable {
    private static final long serialVersionUID = -5750329600021989903L;
    private int sn;
    private String regionName;
    private String deployName;
    private String groupName;
    private String workerName;
    private String className;
    private String groupDesc;
    private String workerDesc;
    private ParamMap infoProps = new ParamMapImpl();
    private ParamMap props = new ParamMapImpl();
    private int index;
    private boolean online;
    private long startTime;
    private String host;
    private String homePath;
    private String ui;
    private int pid;
    private double heapMemory;
    private double nonHeapMemory;
    private int liveThreadCount;

    public WorkerInfo copy() {
        WorkerInfo copy = new WorkerInfo();
        copy.setSn(sn);
        copy.setRegionName(regionName);
        copy.setDeployName(deployName);
        copy.setGroupName(groupName);
        copy.setWorkerName(workerName);
        copy.setClassName(className);
        copy.setGroupDesc(groupDesc);
        copy.setWorkerDesc(workerDesc);
        copy.setInfoProps(infoProps);
        copy.setProps(props);
        copy.setIndex(index);
        copy.setOnline(online);
        copy.setStartTime(startTime);
        copy.setHost(host);
        return copy;
    }

    public int getSn() {
        return sn;
    }

    public void setSn(int sn) {
        this.sn = sn;
    }

    public String getRegionName() {
        return regionName;
    }

    public void setRegionName(String regionName) {
        this.regionName = regionName;
    }

    public String getDeployName() {
        return deployName;
    }

    public void setDeployName(String deployName) {
        this.deployName = deployName;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getWorkerName() {
        return workerName;
    }

    public void setWorkerName(String workerName) {
        this.workerName = workerName;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public ParamMap getInfoProps() {
        return infoProps;
    }

    public void setInfoProps(ParamMap infoProps) {
        this.infoProps = infoProps;
    }

    public ParamMap getProps() {
        return props;
    }

    public void setProps(ParamMap props) {
        this.props = props;
    }

    public String getGroupDesc() {
        return groupDesc;
    }

    public void setGroupDesc(String groupDesc) {
        this.groupDesc = groupDesc;
    }

    public String getWorkerDesc() {
        return workerDesc;
    }

    public void setWorkerDesc(String workerDesc) {
        this.workerDesc = workerDesc;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public boolean getOnline() {
        return online;
    }

    public void setOnline(boolean online) {
        this.online = online;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getHomePath() {
        return homePath;
    }

    public void setHomePath(String homePath) {
        this.homePath = homePath;
    }

    public String getUi() {
        return ui;
    }

    public void setUi(String ui) {
        this.ui = ui;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public double getHeapMemory() {
        return heapMemory;
    }

    public void setHeapMemory(double heapMemory) {
        this.heapMemory = heapMemory;
    }

    public double getNonHeapMemory() {
        return nonHeapMemory;
    }

    public void setNonHeapMemory(double nonHeapMemory) {
        this.nonHeapMemory = nonHeapMemory;
    }

    public int getLiveThreadCount() {
        return liveThreadCount;
    }

    public void setLiveThreadCount(int liveThreadCount) {
        this.liveThreadCount = liveThreadCount;
    }

    @Override
    public String toString() {
        return "WorkerInfo [regionName=" + regionName + ", deployName=" + deployName + ", groupName=" + groupName
                + ", workerName=" + workerName + ", className=" + className + "]";
    }
}
